package com.schoolvisitors.common;

import lombok.Getter;
@Getter
public class EnumParseResult<S extends Enum<S>, T> {
    private final S status;
    private final T data;

    private EnumParseResult(S status, T data) {
        this.status = status;
        this.data = data;
    }

    public static <S extends Enum<S>, T> EnumParseResult<S, T> of(S status, T data) {
        return new EnumParseResult<>(status, data);
    }

    public static <S extends Enum<S>, T> EnumParseResult<S, T> of(S status) {
        return new EnumParseResult<>(status, null);
    }
}

